<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">

<title>会员列表</title>
<!-- Bootstrap core CSS -->
<link href="asserts/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="asserts/css/dashboard.css" rel="stylesheet">
<link th:href="@{/static/mycss.css}" rel="stylesheet">
<!-- import jq -->
<script type="text/javascript" th:src="@{/webjars/jquery/jquery.min.js}"></script>
</head>

<body>
	<div th:replace="~{common/bar::nav}"></div>

	<div class="container-fluid">
		<div class="row">

			<div th:replace="~{common/bar::#sidebar}"></div>

			<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
			<h2>会员信息</h2>
			<div class="table-responsive">
				<table class="table table-striped table-sm">
					<thead>
						<tr>
							<th>账号</th>
							<th>邮箱</th>
							<th>账号创建时间</th>
							<th>状态</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						<tr th:each="member:${members}">
							<td th:text="${member.mAccountname}"></td>
							<td>[[${member.mEmail}]]</td>
							<td th:text="${member.mCreatetime}"></td>
							<td
								th:text="${#strings.containsIgnoreCase(member.mStatus,'0')}?'正常':'异常'"></td>
							<td><button type="button"
									class="btn btn-default btn-sm memope" th:memid="${member.mId}"
									th:statuscode="${member.mStatus}">[[${#strings.containsIgnoreCase(member.mStatus,'0')}?'限制登录':'解除限制']]</button></td>
						</tr>
					</tbody>
				</table>
				<script>
					$(function() {
						$(".memope").click(function() {
							var curOpe=$(this);
							$.ajax({
								url : "memope",
								type : "GET",
								data : {
									"memId" : $(this).attr("memid"),
									"statuscode" : $(this).attr(
											"statuscode")
								},
								success : function(result) {
									if (result.content.mStatus == 1) {
										curOpe.text("解除限制").parent().prev().text("异常");
									} else {
										curOpe.text("限制登录").parent().prev().text("正常");
									}
								},
								error : function(XMLHttpRequest,
										textStatus) {
									alert('未知错误，请重试');
								}
							});
						});
					});
				</script>
			</div>
			</main>
		</div>
	</div>
	<div th:replace="~{common/myjs::#myjs}"></div>
</body>
</html>